package com.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.exam.mapper.ScoreStuMapper;
import com.exam.pojo.entity.ScoreStu;
import com.exam.service.ScoreStuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;
@Service
public class ScoreStuServiceImpl implements ScoreStuService {
   @Autowired
  private ScoreStuMapper scoreMapper;
    @Override
    public List<ScoreStu> findAll() {
        return  scoreMapper.findAll();
    }

    @Override
    public List<ScoreStu> findStuScore(String examName) {
        return scoreMapper.findStuScore(examName);
    }

    /**
     *
     * @return
     */
    @Override
    public List<ScoreStu> findAllName() {
        LambdaQueryWrapper<ScoreStu> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.select(ScoreStu::getExamName);
        return scoreMapper.selectList(queryWrapper);
    }


}
